package com.fresh.api;

import javax.servlet.http.HttpServletRequest;

/**
 *  基础类
 *
 * @author alex
 * @email gaonan.service@gmail.com
 * @date 2017-03-23 15:31
 */

public class BaseController  {
	
   /**
    * 获取登录用户id
    * @param request
    * @return
    */
	public   String getUserId( HttpServletRequest request )  {
		 Object object = request.getSession().getAttribute("USER_ID");
		 if(object ==null){
		 	return  null;
		}else{
			return  (String)object;
		}
	}
	
	
	  /**
	    * 获取登录用户id
	    * @param request
	    * @return
	    */
		public   String getShopId( HttpServletRequest request )  {
			 Object object = request.getSession().getAttribute("SHOP_ID");
			 if(object ==null){
			 	return  null;
			}else{
				return  (String)object;
			}
		}

	
}
